class Solution {
public:
    vector<string> findRelativeRanks(vector<int>& score) {
        vector<int> f(1e6+10,0);
        vector<string> ret;
        string t[4]={"","Gold Medal","Silver Medal","Bronze Medal"};
        for(int i=0;i<score.size();i++)
        {
            f[score[i]]++;
        }
        for(int i=1e6;i>=0;i--)
        {
            f[i]+=f[i+1];
        }
        for(int i=0;i<score.size();i++)
        {
            if(f[score[i]]<=3)
            {
                ret.push_back(t[f[score[i]]]);
            }
            else{
                ret.push_back(to_string(f[score[i]]));
            }
        }
        return ret;
    }
};
